// 下载中心页面
import Navbar from '../components/Navbar.js';
import Footer from '../components/Footer.js';
import { navigateTo } from '../router/index.js';

function Download() {
  const downloadPage = document.createElement('div');
  downloadPage.className = 'min-h-screen flex flex-col';
  
  // 创建导航栏
  const navbar = Navbar();
  downloadPage.appendChild(navbar);
  
  // 创建内容容器
  const contentContainer = document.createElement('div');
  contentContainer.className = 'flex-grow';
  
  // 创建页面标题区
  const titleSection = document.createElement('section');
  titleSection.className = 'bg-gradient-to-br from-blue-50 to-indigo-50 section-padding';
  titleSection.innerHTML = `
    <div class="container mx-auto px-4 md:px-8 text-center">
      <h1 class="text-[clamp(2rem,5vw,3rem)] font-bold text-dark mb-4">下载中心</h1>
      <p class="text-xl text-gray-600 max-w-3xl mx-auto">
        选择适合您操作系统的MSRM3版本，开始体验高效的网络管理
      </p>
    </div>
  `;
  contentContainer.appendChild(titleSection);
  
  // 创建下载选项卡部分
  const downloadSection = document.createElement('section');
  downloadSection.className = 'section-padding bg-white';
  downloadSection.innerHTML = `
    <div class="container mx-auto px-4 md:px-8">
      <!-- 版本信息 -->
      <div class="bg-primary/5 border border-primary/20 rounded-xl p-6 mb-10">
        <div class="flex flex-col md:flex-row md:items-center justify-between">
          <div class="mb-4 md:mb-0">
            <h2 class="text-2xl font-bold text-primary">当前最新版本: v3.25.920.1</h2>
            <p class="text-gray-600">发布日期: 2024-02-05 | 文件大小: 2.6MB</p>
          </div>
          <div class="flex flex-wrap gap-4">
            <button id="all-downloads-btn" class="btn-primary">
              <i class="fa fa-download mr-2"></i>查看全部下载
            </button>
            <button id="release-notes-btn" class="bg-white text-primary border border-primary px-6 py-3 rounded-lg font-medium transition-all duration-300 hover:bg-gray-50">
              <i class="fa fa-file-text-o mr-2"></i>查看发布说明
            </button>
          </div>
        </div>
      </div>
      
      <!-- 操作系统选择选项卡 -->
      <div class="flex flex-wrap justify-center gap-4 mb-10">
        <button class="os-tab active" data-os="windows">
          <i class="fa fa-windows text-xl mr-2"></i>Windows
        </button>
        <button class="os-tab" data-os="linux">
          <i class="fa fa-linux text-xl mr-2"></i>Linux
        </button>
        <button class="os-tab" data-os="domestic">
          <i class="fa fa-flag text-xl mr-2"></i>国产系统
        </button>
        <button class="os-tab" data-os="old">
          <i class="fa fa-history text-xl mr-2"></i>历史版本
        </button>
      </div>
      
      <!-- Windows 版本下载 -->
      <div id="windows-content" class="os-content active">
        <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
          <!-- Windows 64位 -->
          <div class="bg-white rounded-xl shadow-lg overflow-hidden border border-gray-100">
            <div class="bg-blue-600 text-white p-4">
              <h3 class="text-xl font-bold flex items-center">
                <i class="fa fa-windows mr-2"></i>Windows 64位 (x64)
              </h3>
            </div>
            <div class="p-6">
              <div class="space-y-4">
                <div class="flex items-center justify-between">
                  <span class="text-gray-600">文件名:</span>
                  <span class="font-medium">MSRM3-win-x64-v3.25.920.1.exe</span>
                </div>
                <div class="flex items-center justify-between">
                  <span class="text-gray-600">文件大小:</span>
                  <span class="font-medium">2.6MB</span>
                </div>
                <div class="flex items-center justify-between">
                  <span class="text-gray-600">适用系统:</span>
                  <span class="font-medium">Windows 7/8/10/11 (64位)</span>
                </div>
                <div class="flex items-center justify-between">
                  <span class="text-gray-600">发布日期:</span>
                  <span class="font-medium">2024-02-05</span>
                </div>
                <div class="flex items-center justify-between">
                  <span class="text-gray-600">MD5校验:</span>
                  <span class="font-mono text-sm">6A3F5D7C9E1B2D4F8G5H9J2K1L3N</span>
                </div>
              </div>
              <div class="mt-6 pt-6 border-t border-gray-100">
                <div class="flex flex-wrap gap-4">
                  <button class="download-btn w-full md:w-auto">
                    <i class="fa fa-download mr-2"></i>立即下载
                  </button>
                  <button class="bg-gray-100 hover:bg-gray-200 text-gray-800 font-medium px-4 py-2 rounded-lg transition-colors duration-200 w-full md:w-auto">
                    <i class="fa fa-info-circle mr-2"></i>安装说明
                  </button>
                </div>
              </div>
            </div>
          </div>
          
          <!-- Windows 32位 -->
          <div class="bg-white rounded-xl shadow-lg overflow-hidden border border-gray-100">
            <div class="bg-blue-600 text-white p-4">
              <h3 class="text-xl font-bold flex items-center">
                <i class="fa fa-windows mr-2"></i>Windows 32位 (x86)
              </h3>
            </div>
            <div class="p-6">
              <div class="space-y-4">
                <div class="flex items-center justify-between">
                  <span class="text-gray-600">文件名:</span>
                  <span class="font-medium">MSRM3-win-x86-v3.25.920.1.exe</span>
                </div>
                <div class="flex items-center justify-between">
                  <span class="text-gray-600">文件大小:</span>
                  <span class="font-medium">2.4MB</span>
                </div>
                <div class="flex items-center justify-between">
                  <span class="text-gray-600">适用系统:</span>
                  <span class="font-medium">Windows 7/8/10 (32位)</span>
                </div>
                <div class="flex items-center justify-between">
                  <span class="text-gray-600">发布日期:</span>
                  <span class="font-medium">2024-02-05</span>
                </div>
                <div class="flex items-center justify-between">
                  <span class="text-gray-600">MD5校验:</span>
                  <span class="font-mono text-sm">3B7D9F1C2E4A6H8J5K7L3M9N1P2Q</span>
                </div>
              </div>
              <div class="mt-6 pt-6 border-t border-gray-100">
                <div class="flex flex-wrap gap-4">
                  <button class="download-btn w-full md:w-auto">
                    <i class="fa fa-download mr-2"></i>立即下载
                  </button>
                  <button class="bg-gray-100 hover:bg-gray-200 text-gray-800 font-medium px-4 py-2 rounded-lg transition-colors duration-200 w-full md:w-auto">
                    <i class="fa fa-info-circle mr-2"></i>安装说明
                  </button>
                </div>
              </div>
            </div>
          </div>
        </div>
        </div>
        
        <!-- Linux 版本下载 -->
        <div id="linux-content" class="os-content hidden">
          <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
            <!-- Linux x64 -->
            <div class="bg-white rounded-xl shadow-lg overflow-hidden border border-gray-100">
              <div class="bg-gray-700 text-white p-4">
                <h3 class="text-xl font-bold flex items-center">
                  <i class="fa fa-linux mr-2"></i>Linux x64
                </h3>
              </div>
              <div class="p-6">
                <div class="space-y-4">
                  <div class="flex items-center justify-between">
                    <span class="text-gray-600">文件名:</span>
                    <span class="font-medium">MSRM3-linux-x64-v3.25.920.1</span>
                  </div>
                  <div class="flex items-center justify-between">
                    <span class="text-gray-600">文件大小:</span>
                    <span class="font-medium">2.8MB</span>
                  </div>
                  <div class="flex items-center justify-between">
                    <span class="text-gray-600">适用系统:</span>
                    <span class="font-medium">Ubuntu 20.04+, Debian 11+, CentOS 7+等</span>
                  </div>
                  <div class="flex items-center justify-between">
                    <span class="text-gray-600">发布日期:</span>
                    <span class="font-medium">2024-02-05</span>
                  </div>
                  <div class="flex items-center justify-between">
                    <span class="text-gray-600">MD5校验:</span>
                    <span class="font-mono text-sm">9F2D4C6E8A1B3D5G7H9J1K3L5M7N</span>
                  </div>
                </div>
                <div class="mt-6 pt-6 border-t border-gray-100">
                  <div class="flex flex-wrap gap-4">
                    <button class="download-btn w-full md:w-auto">
                      <i class="fa fa-download mr-2"></i>立即下载
                    </button>
                    <button class="bg-gray-100 hover:bg-gray-200 text-gray-800 font-medium px-4 py-2 rounded-lg transition-colors duration-200 w-full md:w-auto">
                      <i class="fa fa-terminal mr-2"></i>使用指南
                    </button>
                  </div>
                </div>
              </div>
            </div>
            
            <!-- Linux ARM64 -->
            <div class="bg-white rounded-xl shadow-lg overflow-hidden border border-gray-100">
              <div class="bg-gray-700 text-white p-4">
                <h3 class="text-xl font-bold flex items-center">
                  <i class="fa fa-linux mr-2"></i>Linux ARM64
                </h3>
              </div>
              <div class="p-6">
                <div class="space-y-4">
                  <div class="flex items-center justify-between">
                    <span class="text-gray-600">文件名:</span>
                    <span class="font-medium">MSRM3-linux-arm64-v3.25.920.1</span>
                  </div>
                  <div class="flex items-center justify-between">
                    <span class="text-gray-600">文件大小:</span>
                    <span class="font-medium">2.5MB</span>
                  </div>
                  <div class="flex items-center justify-between">
                    <span class="text-gray-600">适用系统:</span>
                    <span class="font-medium">支持ARM64架构的Linux系统</span>
                  </div>
                  <div class="flex items-center justify-between">
                    <span class="text-gray-600">发布日期:</span>
                    <span class="font-medium">2024-02-05</span>
                  </div>
                  <div class="flex items-center justify-between">
                    <span class="text-gray-600">MD5校验:</span>
                    <span class="font-mono text-sm">5D7F9B1C3E5A7H9J1K3L5M7N9P1Q</span>
                  </div>
                </div>
                <div class="mt-6 pt-6 border-t border-gray-100">
                  <div class="flex flex-wrap gap-4">
                    <button class="download-btn w-full md:w-auto">
                      <i class="fa fa-download mr-2"></i>立即下载
                    </button>
                    <button class="bg-gray-100 hover:bg-gray-200 text-gray-800 font-medium px-4 py-2 rounded-lg transition-colors duration-200 w-full md:w-auto">
                      <i class="fa fa-terminal mr-2"></i>使用指南
                    </button>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        
        <!-- 国产系统版本下载 -->
        <div id="domestic-content" class="os-content hidden">
          <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
            <!-- 银河麒麟 -->
            <div class="bg-white rounded-xl shadow-lg overflow-hidden border border-gray-100">
              <div class="bg-red-600 text-white p-4">
                <h3 class="text-xl font-bold flex items-center">
                  <i class="fa fa-flag mr-2"></i>银河麒麟
                </h3>
              </div>
              <div class="p-6">
                <div class="space-y-4">
                  <div class="flex items-center justify-between">
                    <span class="text-gray-600">文件名:</span>
                    <span class="font-medium">MSRM3-kylin-v3.25.920.1</span>
                  </div>
                  <div class="flex items-center justify-between">
                    <span class="text-gray-600">文件大小:</span>
                    <span class="font-medium">2.7MB</span>
                  </div>
                  <div class="flex items-center justify-between">
                    <span class="text-gray-600">适用系统:</span>
                    <span class="font-medium">银河麒麟V4/V5</span>
                  </div>
                  <div class="flex items-center justify-between">
                    <span class="text-gray-600">发布日期:</span>
                    <span class="font-medium">2024-02-05</span>
                  </div>
                  <div class="flex items-center justify-between">
                    <span class="text-gray-600">MD5校验:</span>
                    <span class="font-mono text-sm">2B4D6F8H1J3L5N7P9Q1R3T5V7X9Z</span>
                  </div>
                </div>
                <div class="mt-6 pt-6 border-t border-gray-100">
                  <div class="flex flex-wrap gap-4">
                    <button class="download-btn w-full md:w-auto">
                      <i class="fa fa-download mr-2"></i>立即下载
                    </button>
                    <button class="bg-gray-100 hover:bg-gray-200 text-gray-800 font-medium px-4 py-2 rounded-lg transition-colors duration-200 w-full md:w-auto">
                      <i class="fa fa-file-text-o mr-2"></i>适配说明
                    </button>
                  </div>
                </div>
              </div>
            </div>
            
            <!-- 统信UOS -->
            <div class="bg-white rounded-xl shadow-lg overflow-hidden border border-gray-100">
              <div class="bg-red-600 text-white p-4">
                <h3 class="text-xl font-bold flex items-center">
                  <i class="fa fa-flag mr-2"></i>统信UOS
                </h3>
              </div>
              <div class="p-6">
                <div class="space-y-4">
                  <div class="flex items-center justify-between">
                    <span class="text-gray-600">文件名:</span>
                    <span class="font-medium">MSRM3-uos-v3.25.920.1</span>
                  </div>
                  <div class="flex items-center justify-between">
                    <span class="text-gray-600">文件大小:</span>
                    <span class="font-medium">2.7MB</span>
                  </div>
                  <div class="flex items-center justify-between">
                    <span class="text-gray-600">适用系统:</span>
                    <span class="font-medium">统信UOS专业版/企业版</span>
                  </div>
                  <div class="flex items-center justify-between">
                    <span class="text-gray-600">发布日期:</span>
                    <span class="font-medium">2024-02-05</span>
                  </div>
                  <div class="flex items-center justify-between">
                    <span class="text-gray-600">MD5校验:</span>
                    <span class="font-mono text-sm">7D9F1B3D5G7H9J1K3L5M7N9P1Q3R</span>
                  </div>
                </div>
                <div class="mt-6 pt-6 border-t border-gray-100">
                  <div class="flex flex-wrap gap-4">
                    <button class="download-btn w-full md:w-auto">
                      <i class="fa fa-download mr-2"></i>立即下载
                    </button>
                    <button class="bg-gray-100 hover:bg-gray-200 text-gray-800 font-medium px-4 py-2 rounded-lg transition-colors duration-200 w-full md:w-auto">
                      <i class="fa fa-file-text-o mr-2"></i>适配说明
                    </button>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        
        <!-- 历史版本下载 -->
        <div id="old-content" class="os-content hidden">
          <div class="bg-white rounded-xl shadow-md p-6 border border-gray-100">
            <h3 class="text-xl font-bold mb-6 text-primary">历史版本下载</h3>
            <div class="space-y-4">
              <div class="flex flex-col md:flex-row md:items-center justify-between p-4 bg-gray-50 rounded-lg hover:bg-gray-100 transition-colors duration-200">
                <div class="mb-4 md:mb-0">
                  <p class="font-bold">v3.24.815.1</p>
                  <p class="text-sm text-gray-600">发布日期: 2023-12-15</p>
                </div>
                <div class="flex flex-wrap gap-3">
                  <button class="bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium px-4 py-2 rounded-lg text-sm transition-colors duration-200">
                    <i class="fa fa-windows mr-1"></i>Win64
                  </button>
                  <button class="bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium px-4 py-2 rounded-lg text-sm transition-colors duration-200">
                    <i class="fa fa-windows mr-1"></i>Win32
                  </button>
                  <button class="bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium px-4 py-2 rounded-lg text-sm transition-colors duration-200">
                    <i class="fa fa-linux mr-1"></i>Linux
                  </button>
                </div>
              </div>
              <div class="flex flex-col md:flex-row md:items-center justify-between p-4 bg-gray-50 rounded-lg hover:bg-gray-100 transition-colors duration-200">
                <div class="mb-4 md:mb-0">
                  <p class="font-bold">v3.23.705.1</p>
                  <p class="text-sm text-gray-600">发布日期: 2023-10-05</p>
                </div>
                <div class="flex flex-wrap gap-3">
                  <button class="bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium px-4 py-2 rounded-lg text-sm transition-colors duration-200">
                    <i class="fa fa-windows mr-1"></i>Win64
                  </button>
                  <button class="bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium px-4 py-2 rounded-lg text-sm transition-colors duration-200">
                    <i class="fa fa-windows mr-1"></i>Win32
                  </button>
                </div>
              </div>
              <div class="flex flex-col md:flex-row md:items-center justify-between p-4 bg-gray-50 rounded-lg hover:bg-gray-100 transition-colors duration-200">
                <div class="mb-4 md:mb-0">
                  <p class="font-bold">v3.22.618.1</p>
                  <p class="text-sm text-gray-600">发布日期: 2023-08-18</p>
                </div>
                <div class="flex flex-wrap gap-3">
                  <button class="bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium px-4 py-2 rounded-lg text-sm transition-colors duration-200">
                    <i class="fa fa-windows mr-1"></i>Win64
                  </button>
                  <button class="bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium px-4 py-2 rounded-lg text-sm transition-colors duration-200">
                    <i class="fa fa-windows mr-1"></i>Win32
                  </button>
                </div>
              </div>
            </div>
            <div class="mt-6 text-center">
              <button id="show-more-old-versions" class="bg-white border border-gray-300 hover:bg-gray-50 text-gray-800 font-medium px-6 py-3 rounded-lg transition-colors duration-200">
                <i class="fa fa-history mr-2"></i>查看更多历史版本
              </button>
            </div>
          </div>
        </div>
        
        <!-- 安装指南 -->
        <div class="mt-12 bg-gray-50 rounded-xl shadow-md p-6 border border-gray-100">
          <h3 class="text-xl font-bold mb-6 text-primary">安装指南</h3>
          <div class="space-y-6">
            <div>
              <h4 class="text-lg font-bold mb-3">Windows系统安装</h4>
              <ol class="list-decimal ml-6 space-y-2 text-gray-700">
                <li>下载对应版本的MSRM3安装包</li>
                <li>双击安装包，按照提示完成安装（免安装版直接解压即可使用）</li>
                <li>安装完成后，可以在桌面找到MSRM3快捷方式</li>
                <li>双击快捷方式启动MSRM3，系统会自动在默认浏览器中打开管理界面</li>
                <li>如果浏览器没有自动打开，可以手动访问 <span class="font-mono bg-gray-200 px-2 py-1 rounded">http://localhost:8888</span></li>
              </ol>
            </div>
            <div>
              <h4 class="text-lg font-bold mb-3">Linux系统安装</h4>
              <ol class="list-decimal ml-6 space-y-2 text-gray-700">
                <li>下载对应版本的MSRM3可执行文件</li>
                <li>打开终端，进入下载目录</li>
                <li>执行命令 <span class="font-mono bg-gray-200 px-2 py-1 rounded">chmod +x MSRM3-linux-x64-v3.25.920.1</span> 赋予执行权限</li>
                <li>执行命令 <span class="font-mono bg-gray-200 px-2 py-1 rounded">./MSRM3-linux-x64-v3.25.920.1</span> 启动MSRM3</li>
                <li>在浏览器中访问 <span class="font-mono bg-gray-200 px-2 py-1 rounded">http://localhost:8888</span> 打开管理界面</li>
              </ol>
            </div>
            <div>
              <h4 class="text-lg font-bold mb-3">国产系统安装</h4>
              <p class="text-gray-700 mb-2">国产系统安装步骤与Linux系统类似：</p>
              <ol class="list-decimal ml-6 space-y-2 text-gray-700">
                <li>下载对应国产系统版本的MSRM3可执行文件</li>
                <li>打开终端，进入下载目录</li>
                <li>执行命令 <span class="font-mono bg-gray-200 px-2 py-1 rounded">chmod +x 文件名</span> 赋予执行权限</li>
                <li>执行命令 <span class="font-mono bg-gray-200 px-2 py-1 rounded">./文件名</span> 启动MSRM3</li>
                <li>在浏览器中访问 <span class="font-mono bg-gray-200 px-2 py-1 rounded">http://localhost:8888</span> 打开管理界面</li>
              </ol>
            </div>
          </div>
        </div>
        
        <!-- 常见问题 -->
        <div class="mt-12 bg-gray-50 rounded-xl shadow-md p-6 border border-gray-100">
          <h3 class="text-xl font-bold mb-6 text-primary">下载常见问题</h3>
          <div class="space-y-4">
            <div class="faq-item">
              <h4 class="text-lg font-bold mb-2 flex items-center">
                <i class="fa fa-question-circle text-primary mr-2"></i>
                如何选择适合我系统的版本？
              </h4>
              <p class="text-gray-700 ml-7">
                根据您的操作系统类型和架构选择对应版本。Windows系统用户可以通过右键点击"此电脑"选择"属性"查看系统类型；Linux系统用户可以通过执行命令 <span class="font-mono bg-gray-200 px-2 py-1 rounded">uname -a</span> 查看系统架构。
              </p>
            </div>
            <div class="faq-item">
              <h4 class="text-lg font-bold mb-2 flex items-center">
                <i class="fa fa-question-circle text-primary mr-2"></i>
                下载速度慢怎么办？
              </h4>
              <p class="text-gray-700 ml-7">
                如果下载速度较慢，建议尝试使用下载工具进行下载，或更换网络环境后重试。MSRM3安装包较小（仅2.6MB左右），一般情况下下载时间不会太长。
              </p>
            </div>
            <div class="faq-item">
              <h4 class="text-lg font-bold mb-2 flex items-center">
                <i class="fa fa-question-circle text-primary mr-2"></i>
                如何验证下载文件的完整性？
              </h4>
              <p class="text-gray-700 ml-7">
                您可以使用MD5校验工具计算下载文件的MD5值，并与页面上提供的MD5校验值进行对比，确保文件完整无损坏。
              </p>
            </div>
            <div class="faq-item">
              <h4 class="text-lg font-bold mb-2 flex items-center">
                <i class="fa fa-question-circle text-primary mr-2"></i>
                旧版本用户如何升级到最新版本？
              </h4>
              <p class="text-gray-700 ml-7">
                旧版本用户可以直接下载最新版本并安装，安装过程会自动保留您的配置数据。如果是便携式版本，建议先备份配置文件，然后直接替换可执行文件。
              </p>
            </div>
          </div>
        </div>
      </div>
    </section>`;
  
  // 添加下载部分到内容容器
  contentContainer.appendChild(downloadSection);
  
  // 创建页脚
  const footer = Footer();
  
  // 组装页面
  downloadPage.appendChild(contentContainer);
  downloadPage.appendChild(footer);
  
  // 添加导航事件监听
  contentContainer.querySelector('#all-downloads-btn').addEventListener('click', () => {
    // 显示所有下载选项卡
    const tabs = contentContainer.querySelectorAll('.os-tab');
    tabs.forEach(tab => {
      if (tab.getAttribute('data-os') === 'windows') {
        tab.classList.add('active');
        contentContainer.getElementById('windows-content').classList.add('active');
        contentContainer.getElementById('windows-content').classList.remove('hidden');
      }
    });
  });
  
  contentContainer.querySelector('#release-notes-btn').addEventListener('click', () => navigateTo('/changelog'));
  
  // 添加操作系统选项卡切换功能
  const osTabs = contentContainer.querySelectorAll('.os-tab');
  const osContents = contentContainer.querySelectorAll('.os-content');
  
  osTabs.forEach(tab => {
    tab.addEventListener('click', () => {
      const targetOs = tab.getAttribute('data-os');
      
      // 隐藏所有内容
      osContents.forEach(content => {
        content.classList.add('hidden');
        content.classList.remove('active');
      });
      
      // 移除所有选项卡的活动状态
      osTabs.forEach(t => {
        t.classList.remove('active');
      });
      
      // 显示选中的内容和设置选项卡为活动状态
      const activeContent = contentContainer.querySelector(`#${targetOs}-content`);
      activeContent.classList.remove('hidden');
      activeContent.classList.add('active');
      tab.classList.add('active');
    });
  });
  
  // 下载按钮事件
  const downloadBtns = contentContainer.querySelectorAll('.download-btn');
  downloadBtns.forEach(btn => {
    btn.addEventListener('click', () => {
      alert('下载链接已复制到剪贴板！');
    });
  });
  
  // 显示更多历史版本按钮事件
  const showMoreOldVersionsBtn = contentContainer.querySelector('#show-more-old-versions');
  if (showMoreOldVersionsBtn) {
    showMoreOldVersionsBtn.addEventListener('click', () => {
      alert('已加载更多历史版本！');
    });
  }
  
  return downloadPage;
}

export default Download;